import { AppGlobalService } from 'src/app/shared/service/app-global.service';
import { Component, Input, OnInit } from '@angular/core';
import { link } from 'fs';
import { Platform } from '@ionic/angular';
import { PageModalService } from 'src/app/shared/service/page-modal-service';

@Component({
  selector: 'app-person-sign',
  templateUrl: './person-sign.component.html',
  styleUrls: ['./person-sign.component.scss'],
})
export class PersonSignComponent implements OnInit {

  @Input() tagData: any;
  constructor(
    private appGlobalService: AppGlobalService,
    private pageModalService: PageModalService,

    private platform: Platform
  ) { }

  ngOnInit() {
    // this.tagData =
    //   {
    //     type: "tag",
    //     style: "Tag",
    //     name: "Tag",
    //     cssStyle: '',
    //     data:
    //     {
    //       data: [
    //         {
    //           serviceMonth: '从业<font weight="bold" color="#FF6314"> 1年36个月</font>',
    //           serviceCustomer: '服务客户<font color="#FF6314">15960</font>',
    //           sign: '个性签名：我从业11年，非常擅长餐厅类店铺，服务上万客户,我从业11年，非常擅长餐厅类店铺',
    //           iconName: 'personal center_icon_edit@3x.png',
    //           link: {
    //             type: "page",
    //             params: {
    //                 showName: "#opportunity_rent"
    //             },
    //             target: "161506"
    //           }
    //         }
    //       ]

    //     }
    //   };
  }

  editClick(linkObj) {
    this.appGlobalService.openPage(linkObj);
  }

  copyStr(str) {
    this.appGlobalService.copyString(str, '邀请码');
  }
  openPage(link) {
    this.pageModalService.openPage(link);
  }

  call(item) {
    if (item.superiorName && item.superiorMobile) {
      this.pageModalService.call({ name: item.superiorName, phone: item.superiorMobile});      
    }
  }
}
